package com.cjh.springcloud.service;

import com.cjh.springcloud.pojo.Emp;
import lombok.extern.apachecommons.CommonsLog;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author cjh
 * @Date 2020/12/10 10:46
 * @Version 1.0
 * feign服务接口
 *
 * fallbackFactory：配置服务降级
 */
@Component
@FeignClient(value = "SPRINGCLOUD-PROVIDER-EMP",fallbackFactory = EmpClientServiceFallBackFactory.class)
public interface EmpClientService {

    @RequestMapping("/provider/queryOne/{empId}")
    Emp getById(@PathVariable("empId") Integer empId);

    @RequestMapping("/provider/queryAll")
    List<Emp> getAll();
}
